import React from 'react'
import { NavBar, Field } from 'react-vant';
import { MoreOutlined, RightOutlined, DownOutlined } from '@ant-design/icons';
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';

export default function Orderss() {
    const navigate = useNavigate()
    const history=useLocation()
    console.log(history.state);
    const list=history.state.list
    // const [search]=useSearchParams()
    // console.log(search.get('list'));
    return (
        <div>
            <div className="head">
                <NavBar
                    title="回收订单"
                    leftText=""
                    rightText={<MoreOutlined style={{ fontSize: '20px' }} />}
                    onClickLeft={() => { navigate(-1) }}
                    onClickRight={() => Toast('按钮')}
                />
            </div>
            <div style={{display:'flex',flexWrap:'wrap',justifyContent:'space-around'}}>
            {
                list.map(item=>{
                    return <div key={item._id} style={{
                        border:'1px solid #ccc',
                        marginTop:'10px',
                        textAlign:'center',
                        width:'200px',
                        padding:'20px',
                        boxSizing:'border-box'
                    }}>
                        <img src={item.img} alt="" style={{width:'150px',height:'200px'}}/>
                        <p>{item.title}</p>
                        <h4 style={{color:'red'}}>￥{item.num}元</h4>
                    </div>
                })
            }
            </div>
        </div>
    )
}
